package com.example.mybatis.controller;

import com.example.mybatis.pojo.Person;
import com.example.mybatis.service.PersonService;
import org.apache.ibatis.session.defaults.DefaultSqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/person/")
public class PersonController {
    @Autowired
    private PersonService personService;
    @ResponseBody
    @RequestMapping("findOne/{pageNum}/{pageSize}")
    public List<Person> findOne(@PathVariable("pageNum") int pageNum, @PathVariable("pageSize") int pageSize) {
        return personService.findOne(pageNum,pageSize);
    }
}
